KERNEL_NAME = linux-4.19
KERNEL_ROOT ?= $(OUT_DIR)/../../../kernel/OBJ/$(KERNEL_NAME)
ARCH ?= arm
OSTYPE ?= linux
MDP_PATH ?= $(shell pwd)/../../include/mdp
OSAL_ROOT ?= $(shell pwd)
INS_KO = $(OUT_DIR)

OHOS_BUILD_HOME := $(realpath $(shell pwd)/../../../../../../../../)
CLANG_HOST_TOOLCHAIN := $(OHOS_BUILD_HOME)/prebuilts/clang/ohos/linux-x86_64/llvm/bin
KERNEL_HOSTCC := $(CLANG_HOST_TOOLCHAIN)/clang
CLANG_CC := $(CLANG_HOST_TOOLCHAIN)/clang

PREBUILTS_GCC_DIR := $(OHOS_BUILD_HOME)/prebuilts/gcc
ifeq ($(ARCH), arm)
    KERNEL_TARGET_TOOLCHAIN := $(PREBUILTS_GCC_DIR)/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/bin
    KERNEL_TARGET_TOOLCHAIN_PREFIX := $(KERNEL_TARGET_TOOLCHAIN)/arm-linux-gnueabi-
else ifeq ($(ARCH), arm64)
    KERNEL_TARGET_TOOLCHAIN := $(PREBUILTS_GCC_DIR)/linux-x86/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin
    KERNEL_TARGET_TOOLCHAIN_PREFIX := $(KERNEL_TARGET_TOOLCHAIN)/aarch64-linux-gnu-
endif
TARGET_COMPILE := $(KERNEL_TARGET_TOOLCHAIN_PREFIX)
KERNEL_CROSS_COMPILE := CC="$(CLANG_CC)"
KERNEL_CROSS_COMPILE += CROSS_COMPILE="$(KERNEL_TARGET_TOOLCHAIN_PREFIX)"

COMM_INC := -I$(OSAL_ROOT)/include

OSAL_CFLAGS += -Wall 
OSAL_CFLAGS += -D_USE_LLI_ -DARCH_LOMBO_N7V3
OSAL_CFLAGS += $(COMM_INC)
OSAL_CFLAGS += -Wno-date-time

export KERNEL_CROSS_COMPILE KERNEL_ROOT ARCH OSTYPE MDP_PATH OSAL_ROOT INS_KO OSAL_CFLAGS
